package com.excellent.system.service.impl;

import java.util.List;

import com.excellent.system.domain.SysUserGroupInterview;
import com.excellent.system.domain.SysUserGroupMachine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.excellent.system.mapper.SysUserGroupMapper;
import com.excellent.system.service.ISysUserGroupService;
import com.excellent.common.core.text.Convert;

/**
 * 用户和角色关联Service业务层处理
 *
 * @author YYY
 * @date 2020-12-24
 */
@Service
public class SysUserGroupServiceImpl implements ISysUserGroupService
{
    @Autowired
    private SysUserGroupMapper sysUserGroupMapper;

    /**
     * 查询用户和角色关联
     *
     * @param userId 用户和角色关联ID
     * @return 用户和角色关联
     */
    @Override
    public SysUserGroupInterview selectSysUserGroupInterviewById(String userId)
    {
        return sysUserGroupMapper.selectSysUserGroupInterviewById(userId);
    }

    @Override
    public SysUserGroupMachine selectSysUserGroupMachineById(String userId)
    {
        return sysUserGroupMapper.selectSysUserGroupMachineById(userId);
    }
    /**
     * 查询用户和角色关联列表
     *
     * @param sysUserGroupInterview 用户和角色关联
     * @return 用户和角色关联
     */
    @Override
    public List<SysUserGroupInterview> selectSysUserGroupInterviewList(SysUserGroupInterview sysUserGroupInterview)
    {
        return sysUserGroupMapper.selectSysUserGroupInterviewList(sysUserGroupInterview);
    }
    @Override
    public List<SysUserGroupMachine> selectSysUserGroupMachineList(SysUserGroupMachine sysUserGroupMachine)
    {
        return sysUserGroupMapper.selectSysUserGroupMachineList(sysUserGroupMachine);
    }

    /**
     * 新增用户和角色关联
     *
     * @param sysUserGroupInterview 用户和角色关联
     * @return 结果
     */
    @Override
    public int insertSysUserGroupInterview(SysUserGroupInterview sysUserGroupInterview)
    {
        return sysUserGroupMapper.insertSysUserGroupInterview(sysUserGroupInterview);
    }
    @Override
    public int insertSysUserGroupMachine(SysUserGroupMachine sysUserGroupMachine)
    {
        return sysUserGroupMapper.insertSysUserGroupMachine(sysUserGroupMachine);
    }

    /**
     * 修改用户和角色关联
     *
     * @param sysUserGroupInterview 用户和角色关联
     * @return 结果
     */
    @Override
    public int updateSysUserGroupInterview(SysUserGroupInterview sysUserGroupInterview)
    {
        return sysUserGroupMapper.updateSysUserGroupInterview(sysUserGroupInterview);
    }
    @Override
    public int updateSysUserGroupMachine(SysUserGroupMachine sysUserGroupMachine)
    {
        return sysUserGroupMapper.updateSysUserGroupMachine(sysUserGroupMachine);
    }

    /**
     * 删除用户和角色关联对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysUserGroupInterviewByIds(String ids)
    {
        return sysUserGroupMapper.deleteSysUserGroupInterviewByIds(Convert.toStrArray(ids));
    }
    @Override
    public int deleteSysUserGroupMachineByIds(String ids)
    {
        return sysUserGroupMapper.deleteSysUserGroupMachineByIds(Convert.toStrArray(ids));
    }
    /**
     * 删除用户和角色关联信息
     *
     * @param userId 用户和角色关联ID
     * @return 结果
     */
    @Override
    public int deleteSysUserGroupInterviewById(String userId)
    {
        return sysUserGroupMapper.deleteSysUserGroupInterviewById(userId);
    }
    @Override
    public int deleteSysUserGroupMachineById(String userId)
    {
        return sysUserGroupMapper.deleteSysUserGroupMachineById(userId);
    }
}
